home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Sample Controls / Console / CConsoleControl.h < prev    next >
Encoding:
Text File  |  1996-12-20  |  1.8 KB  |  62 lines  |  [TEXT/CWIE]

  1.  
  2. ///////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Constants
  5. //
  6.  
  7.  
  8. const short NUM_CONNECTIONS = 1;    // This control only has one connection point
  9.  
  10. ///////////////////////////////////////////////////////////////////////////////
  11. //
  12. // Class declaration
  13. //
  14.  
  15. class CConsoleControl :  
  16.     public CBaseControl,
  17.     public IDidMenuEvents
  18. {
  19. public:
  20.     //  *** CConsoleControl methods ***
  21.     CConsoleControl(void);
  22.     ~CConsoleControl(void);
  23.  
  24.     //  *** IUnknown methods ***
  25.     STDMETHOD (QueryInterface)(REFIID RefID, void** Obj);
  26.     STDMETHOD_(ULONG,AddRef)(THIS) {CBaseControl::AddRef();}
  27.     STDMETHOD_(ULONG,Release)(THIS) {CBaseControl::Release();}
  28.     
  29.     // *** IObjectWithSite methods ***
  30.     STDMETHOD (SetSite)(THIS_ IUnknown* inUnkSite);
  31.     
  32.     // *** IControl methods ***
  33.     STDMETHOD (Draw) (THIS_ DrawContext* Context);
  34.     STDMETHOD (DoIdle)(THIS_ Uint32 IdleRefCon);
  35.     
  36.     // *** IDidMenuEvents methods ***
  37.     STDMETHOD (Click)(THIS_ IUnknown* Source, PlatformEvent* Event, char * originatorName, const CMenuItem & Item);
  38.  
  39.     //  *** IPersistPropertyBag methods ***
  40.     STDMETHOD (Load)(IPropertyBag* propertyBag, IErrorLog* errorLog);
  41.     
  42.     // Event sending
  43.     STDMETHOD (FireEvent)(REFIID RefID, long EventID, PlatformEvent* Event);
  44.     STDMETHOD (FireOneEvent)(REFIID RefID, long EventID, IUnknown* EventTarget, EventRecord* Event);
  45.  
  46. protected:
  47.     void    FinishEvent(void);
  48.     void    AddMessage(Str255 inMessage);    
  49.     void     InitMessages(DrawContext* inContext);
  50.     long     ParseMenuItem(const CMenuItem & item);
  51.  
  52. private:
  53.     Str255**         m_Message;
  54.     short            m_NumMsgs;
  55.     short            m_CurrentMsg;
  56.     DWORD            m_Cookie;
  57.     CMenuItem        mTempMenuItem;
  58.     IUnknown *        mClickSource;    // the object that sent us the Click message
  59.     Boolean            mIsIdling;        // True if we're getting idle time
  60. };
  61.  
  62.